﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BFlatCompile
{
	public class Token
	{
		private string[] lines;

		public Token(string value, string file, string relativeFile, string[] lines, int line, int column)
		{
			this.Value = value;
			this.File = file;
			this.RelativeFile = relativeFile;
			this.LineNum = line;
			this.Column = column;
			this.lines = lines;
		}

		public string Value { get; private set; }
		public string File { get; private set; }
		public string RelativeFile { get; private set; }
		public int LineNum { get; private set; }
		public int Column { get; private set; }

		public string Line
		{
			get
			{
				return this.lines[this.LineNum];
			}
		}

		internal void AppendValue(string value)
		{
			this.Value += value;
		}

		public override string ToString()
		{
			return "\"" + this.Value + "\"";
		}
	}
}
